
                       Chkunin, by Randy Hall


If you are reading this, you have successfully un-zipped PRIMO.ZIP.


*********************** Updates ************************

Version 7.1.0, April 10, 2017.
------------------------------
Several antivirus programs, like Avast, are flagging primo.zip with
having many viruses. I have traced this down to a problem with the code 
generated by the GCC compiler for chkunin accessing the registry.
So I have installed Microsoft's Visual Studio 2017 to compile chkunin.
The VS version does not create false virus warnings.

Version 7.1.0, May 27, 2016.
------------------------------
We may not want to delete some folders, like "Program Files", so check for them.
Also, programs installed in "C:\Program Files" may also put folders in 
"C:\Users\Randy\AppData\Local\VirtualStore\Program Files"
so to stop chkunin from 'finding' folders in "C:\Program Files" that are not there,
you also have to make sure there are none in 
"C:\Users\Randy\AppData\Local\VirtualStore\Program Files".
Code was added to chkunin to (hopefully) do this.


Version 7.0.2, September 20, 2015.
------------------------------
Thanks to "Voodoo Master", I found a bug in the way I was loading an allocated
chunk of memory. This has been fixed. I also fixed several other possible
error problems.

Version 7.0.1, September 14, 2015.
------------------------------
Since the do_not_modify file is optional, I decided to not show the info
message that it was missing.Also, to avoid any confusion with the name of 
the file I changed it from "do_not_modify.txt" to "do_not_modify_list.txt".
That way someone won't mistake it meaning you cannot modify the file.

Version 7.0.0, September 11, 2015.
------------------------------
With thanks to Stefan Martens, I have made a bunch of changes to Chkunin.
Version 7.0.0 of Chkunin has many changes, that hopefully improve it.
The .REG files are hopefully more accurate. There are several more error
checking procedures which you will hopefully never see. For "Values modified"
Chkunin internally checks for registry keys "\Seed:", "\TotalUsedClusters:",
"\BitBucket\" and "\MountPoints\" and does not generate a change command in
the .MODS.REG file. A new feature has been added to Chkunin, a file called
"do_not_modify.txt" used to add other registry keys/values you do not
want to change. If you do not have a "do_not_modify.txt" file, a message box
will pop up informing you. Chkunin runs without "do_not_modify.txt" and is
just informing you it was not found.
"do_not_modify.txt" must be in the same folder as the Chkunin program.

August 29, 2015
I have converted Chkunin so I can use the Bloodshot DEV-C++ compiler
so it now uses Win API rather than MFC.
I have also changed the program names again, for hopefully the last time.
They are now ...
Chkunin-x64-ANSI.exe is the 64-bit self-contained version.
chkunin-x86-ANSI.exe is the 32-bit self-contained version.

Version 6.1.2, August 06, 2015.
------------------------------

If there are no Folders to delete, don't generate the prompt.
Also, I'm only creating the stand alone versions now.

Version 6.1.1, March 05, 2015.
------------------------------

Konstantin ran in to a problem running the 64-bit version, on, I think,
XP 64-bit. The MFC .DLL modules needed were not there.
So, I created a self-contained 64-bit version that he says works.

Version 6.1.1, Feb 11, 2015.
------------------------------

I have discovered that compiling "chkunin-x86-ANSI.exe" using Visual Studio
2010 on a 64-bit machine does not create a valid 32-bit version unless you
include all modules necessary... easy fix, but the mfc modules add 1600K to 
the .exe. Still a small program by todays standards!
And, for those of you still using XP, it works there too.

Gyu in Hungary ran in to a problem...he ran Regshot in Hungarian,
but Chkunin only understands English, so it said
".BAT, and .REG files do not exist."
When he runs Regshot in English it works.
I have changed the message...
from...
".BAT, and .REG files do not exist."
to...
    ".BAT, and .REG files do not exist."
    "Chkunin did not find any left-over files"
    "or registry entries."
    "Also, the .TXT file must be in English."
Hopefully this is better and means that the program you 
uninstalled actually deleted everything it added to your system.
...
And, thanks to a suggestion from Matthew Wai, I have added code to 
the .BAT files that ask if you want to remove the prompt for each
folder that is to be deleted. This makes it faster if there are a 
lot of folders to be deleted.
NOTE.... This version DOES work in XP.


Version 6.1.0, Aug 30, 2014.
------------------------------
Since the output of Regshot is different than primo.exe, I discovered
that a DEL command was not being generated for some files in CHKUNIN.
This has been fixed.
NOTE.... This version does not work in XP. Use "Chkunin_32_XP.exe".


Version 6.0.1, July 29, 2014.
------------------------------
I didn't change the version number this time...(I forgot!)
Chkunin was not generating all the RMDIR commands it should have.
NOTE.... This version does not work in XP. Use "Chkunin_32_XP.exe".


Version 6.0.1, June 08, 2014.
------------------------------
And here I thought I was finished!
Processing a large regshot output, a buffer over-run caused a heap error.
NOTE.... This version does not work in XP. Use "Chkunin_32_XP.exe".

Version 6.0.0, June 05, 2014.
------------------------------
I recreated the project again using Visual Studio 2010 C++.
This, hopefully final version, does not need a registry entry
or a .INI file, as it doesn't keep any info.
I also cleaned it up again, and it is now down to 145K.
NOTE.... This version does not work in XP. Use "Chkunin_32_XP.exe".

Version 5.0.0, June 02, 2014.
------------------------------
When I compiled the Visual Studio C++ 6 code with Visual Studio 2010,
the size went from about 60K to 2.3M. I could not figure out why it was
so big, so I recreated the project using Visual Studio 2010 C++.
I also cleaned it up a bit, and it is now down to 162K.
NOTE.... This version does not work in XP. Use "Chkunin_32_XP.exe".

Version 4.1.0, May 26, 2014.
------------------------------
Thanks to Visual Studio 2010, I found a fairly major bug in Chkunin64, in that 
it was not getting the correct number of files added, and was also generating
DEL commands for modified files. This has been fixed.
I also modified it so that you can call it any name, and it will still find
CHKUNIN.TXT as long as it is in the same folder as CHKUNIN64.EXE.
So you could call CHKUNIN64.EXE abc.exe and it would still access CHKUNIN.TXT.

Version 4.0.0, April 25, 2014.
------------------------------
Since I have Visual Studio 2010 for a while, I hace created a 64-bit version of
Chkunin and have called it chkunin64.exe, but from the testing I have done, the
output of this is the same as the output from the 32-bit version.

Version 3.1.0, April 19, 2014.
------------------------------
I now have Visual Studio 2010 with which I can create a 64-bit version of
Regshot. But I will leave in the changes made to Chkunin Feb 12.

Version 3.1.0, February 12, 2014.
------------------------------
Now that I have Windows 8 64-bit, I discovered that some registry entries
for 32-bit software go in to a special registry key, Wow6432Node.
Since Visual C++ 6.0 only creates a 32bit program, I modified Chkunin
to hopefully compensate for this by adding "Wow6432Node" to the key if it
is not found without it.
I also modified it to accept HKLM as well as "HKEY_LOCAL_MACHINE" as a key.
This allows it to use output from the 1.9.0 version of Regshot.
See Regshot.txt for details.

Version 3.0.1, February 26, 2012.
------------------------------
REG_SZ restore commands were missing double backslashs, and had 1 too many 
quotes at the end.
REG_DWORD does not have 0X in front of data!

Version 3.0.0, February 23, 2012.
------------------------------
Add code to generate restore commands for REG_EXPAND_SZ  and REG_MULTI_SZ 
registry key values that have been modified.
If the registry value is not the same length and data as what is in the Primo
file, no restore command is generated as this means something else modified
the data in that registry key.

Version 2.2.0, February 22, 2012.
------------------------------
Clean up several areas where buffer over-runs could occur.
Since I have deleted files by mistake by running the .BAT file, add code to 
prompt you to see if you really want to delete the files.

Version 2.0.0, February 20, 2012.
------------------------------
Chkunin has been updated to generate restore commands for 
registry key values that have been modified.
A new file, called *_MODS.REG contains the registry commands to restore values.
Currently, only REG_BINARY, REG_DWORD, and REG_SZ data types are processed.
Some keys will not be restored. So far, they are...
   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG\Seed
If you know of others that should not be restored, let me know.
There is a caveat.... this will work if you install and then un-install one 
program at a time, but if you install more than one program that modifies the 
same registry value, there could be a problem if you un-install the first 
program, and then restored the values to the first installed program values. 


Version 1.3.0, February 09, 2012.
------------------------------
Version 1.3.0 fixes a problem caused when trying to read registry keys.
Rather than issuing many "Insufficient system resources exist to complete the 
requested service" messages, Chkunin has been modified to create an error file 
called "*.errors.txt" and an error message will be put in to this file. 
A message box tells you if this file is created.
From what I can gather from the internet, there may be a bug in XP that causes 
Chkunin to issue an "Insufficient system resources exist to complete the 
requested service." message that appears to be caused by reading the registry. 
I discovered this when I installed Spybot - Search and Destroy, and later 
deleted it. When I ran the Spybot.txt file through Chkunin, it started pumping 
out the error message for a lot of the 121563 keys that Spybot had added to the 
registry.
Version 1.2.2, May 27, 2010.
------------------------------
Version 1.2.2 fixes a display problem for a large amount of
data in the .reg output file. This will probably not happen if 
you have un-installed the application first. It happened to me
when I ran Chkunin on a Primo file and it created a .REG file that
was 11 meg in size. OpenDocumentFile could not handle it.
I also cleaned up a bit more code.

Version 1.2.1, May 25, 2010.
------------------------------
Version 1.2.1 fixes a buffer-overrun when processing a large amount of
data in a registry key.
Several other possible over-run areas were also fixed.
This version (and all new ones) should now properly handle the old 
Files Added that do not have the Date: line as well as ones that do.

Version 1.2.0, May 11, 2010.
------------------------------
Version 1.2.0 will not delete registry data from:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\
If you delete the RunOnce key, I found you can't add new USB devices.
Deleting BitBucket data may not be good... anyone know why?
The data in MountPoints seems to come right back anyway.

Version 1.0.1, Aug 08, 2009.
------------------------------

Corrected a bug where Chkunin was not processing all files in the 
"Files added:" section.

Version 1.1.0, June 06, 2008.
------------------------------
I discovered a bug in the way "Files added" was being handled. Entries
from the "Files modified" section were being included as files added.
Also, I added a popup window to display errors accessing registry keys.
The only one I have seen so far is "access denied" in Vista.

Version 1.0.0, May 16, 2008.
------------------------------
Chkunin is a modified version of my Chkctrl5 program.
It has been modified to use the text output of Primo, my
version of Regshot, a registry and folder monitoring program.
Chkunin only produces a .BAT and .REG output file.

****************************************************************

You can email me at bitron@islandnet.com if you have any problems 
or questions. Thanks...

